package com.my.java.mq.rabbitmq;

import java.io.IOException;
import java.util.HashMap;
import java.util.concurrent.TimeoutException;

/**
 * @author 作者 ucs_fuqing
 * @date 创建时间：2017年8月11日 下午2:44:59
 * @version 1.0
 * @parameter
 * @since
 * @return
 */
public class MainTest {
        public MainTest() throws IOException, TimeoutException {
//                QueueConsumer consumer = new QueueConsumer("testqueue");
//                Thread cuThread = new Thread(consumer);

//                cuThread.start();

                Producer producer = new Producer("testqueue");
                int i = 0;
                while (i < 10) {
                        HashMap<String, String> hm = new HashMap<>();
                        hm.put("tagId", i+"");
                        producer.sendMessage(hm);
                        System.out.println("发送第" + i + "消息");
                        i++;
                }
        }

        public static void main(String[] args) throws IOException, TimeoutException {
                new MainTest();
        }
}